package com.qingfeng.core.utils;

import com.fasterxml.uuid.EthernetAddress;
import com.fasterxml.uuid.Generators;
import com.fasterxml.uuid.impl.TimeBasedGenerator;

/**
 * @description: UUID工具类
 * @author:LWY
 * @date: 2017/10/13 17:08
 * @modified:
 */
public class UuidUtil {
    /**
     * @return UUID String
     * @description:主键生成策略（32位）
     */
    public static String generatorUUID() {
        TimeBasedGenerator timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
        return timeBasedGenerator.generate().toString().replace("-", "");
    }


    public static void main(String[] args) {
        System.out.println(generatorUUID());
    }
}
